package com.cmii.sjw.department.control.jsc.controller;

import com.cmii.sjw.department.control.jsc.model.base.InstitutionsData;
import com.cmii.sjw.department.control.jsc.model.base.OrderStatData;
import com.cmii.sjw.department.control.jsc.model.base.StudentStatData;
import com.cmii.sjw.department.control.jsc.service.SupervisionService;
import com.cmii.sjw.department.control.jsc.util.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

/**
 * 培训监管Controller
 *
 * @author lizheng
 * @date 2025-05-19
 */
@RestController
@CrossOrigin
@RequestMapping("/supervision")
public class SupervisionController {

    @Resource
    private SupervisionService supervisionService;

    /**
     * 学生统计
     * @return 获取json数据
     */
    @PostMapping("/statistics")
    public Result<StudentStatData> statistics() {
        StudentStatData data = supervisionService.statistics();
        return Result.success(data);
    }

    /**
     * 订单统计
     * @return 获取json数据
     */
    @PostMapping("/order")
    public Result<OrderStatData> order() {
        OrderStatData data = supervisionService.order();
        return Result.success(data);
    }

    /**
     * 机构统计
     * @return 获取json数据
     */
    @PostMapping("/institutions")
    public Result<InstitutionsData> institutions() {
        InstitutionsData data = supervisionService.institutions();
        return Result.success(data);
    }
}
